/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projetlif13.notused.controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JComponent;

/**
 *
 * @author Yohan B.
 */

/*
 * Custom abstract controller
 */
public abstract class AbstractController implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        JComponent component = (JComponent) e.getSource();
        String name = component.getName();
        if (name != null) {
            System.out.println("Action performed on " + name);
            actionPerformed(component, name, e);
        } else {
            System.err.println("JComponent name is null.");
        }
    }

    public abstract void actionPerformed(JComponent component, String name, ActionEvent evt);
}
